home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 145 / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin / tools / sharp / sxwork1.lzh / INCLUDE / TASK.H < prev    next >
Text File  |  1994-02-20  |  12KB  |  532 lines

  1. /*
  2.  * task.h X68k SX_SYSTEM ver 2.01 Copyright 1994 SHARP/First Class Technology
  3.  */
  4. #ifndef __TASK_H
  5. #define __TASK_H
  6.  
  7. #ifndef __SXDEF2_H
  8. #include <sxdef2.h>
  9. #endif
  10.  
  11. #ifdef FORWORD
  12. #define __PROTO_TYPE
  13. #endif
  14. #ifdef __STDC__
  15. #define __PROTO_TYPE
  16. #endif
  17.  
  18. typedef enum TSEventCode TSEventCode;
  19. typedef enum TaskState    TaskState;
  20. typedef enum CMDSRscID    CMDSRscID;
  21.  
  22. typedef struct Task    Task;
  23. typedef struct Builtin    Builtin;
  24. typedef struct Cell    Cell;
  25. typedef struct Drag    Drag;
  26. typedef struct Scrap    Scrap;
  27. typedef struct DrvInfo    DrvInfo;
  28. typedef struct OpenFile    OpenFile;
  29. typedef struct IcKind    IcKind;
  30. typedef struct IcState    IcState;
  31. /*
  32.  *    タスクマン (Task Man)
  33.  */
  34. #ifndef SXKERNEL
  35. #define SXKERNEL    "sxkernel.x"
  36. #endif
  37. #ifndef SXVER2
  38. #define SXVER2        0x0201
  39. #endif
  40. #define TS_OWN        (-1)
  41. #define TS_FINISH    0
  42. #define TS_PUTBACK    (-1)
  43.  
  44. enum TSEventCode {
  45.     STARTUP,
  46.     ENDTSK,
  47.     CLOSEALL,
  48.     NOTICEEJECT,
  49.     DISKEJECT,
  50.     NOTICEFORMAT,
  51.     DISKFORMAT,
  52.     NOTICEDCOPY,
  53.     DISKCOPY,
  54.     DISKINSERT,
  55.     REMOVEDIR,
  56.     DELETEFILE,
  57.     DELETEVONAME,
  58.     MOVEFILE,
  59.     COPYFILE,
  60.     MAKEDIR,
  61.     CREATFILE,
  62.     CREATEVONAME,
  63.     OPENFILE    =  20,
  64.     CLOSEFILE,
  65.     CHMODFILE,
  66.     CLOSEPATH    =  30,
  67.     SAVE,
  68.     WINDOWSELECT,
  69.     NOTICEENDTSK,
  70.     TOSCRAP        =  50,
  71.     EMPTYTRASH,
  72.     CREATETSK    =  70,
  73.     EXITTSK,
  74.     DRAGNOW        =  80,
  75.     DRAGEND,
  76.     SETFONT        =  85,
  77.     CHANGEFONT,
  78.     CHANGERSC    =  90,
  79.     DELETERSC,
  80.     REQLOADRSC    = 104,
  81.     RESLOADRSC
  82. };
  83.  
  84. enum TaskState {
  85.     TS_EMPTY,
  86.     TS_ACTIVE,
  87.     TS_COMMUNICATE,
  88.     TS_SENDMES,
  89.     TS_SLEEP,
  90.     TS_STARTUP,
  91.     TS_LOAD,
  92.     TS_EXIT
  93. };
  94.  
  95. enum CMDSRscID {
  96.     CMDSDIR,
  97.     CMDSCHD,
  98.     CMDSPINFO,
  99.     CMDSDINFO,
  100.     CMDSINFO,
  101.     CMDSCLO,
  102.     CMDSREN,
  103.     CMDSCLIP,
  104.     CMDSVDCP,
  105.     CMDSVFOR,
  106.     CMDSCOPY,
  107.     CMDSCSHL,
  108.     CMDSHENW,
  109.     CMDSTITL,
  110.     CMDSLDLB,
  111.     CMDSADJS,
  112.     CMDSFALL,
  113.     CMDSFILE    /* 17 */
  114. };
  115.  
  116. #define TS_RDONLY    1
  117. #define TS_HIDDEN    (1 << 1)
  118. #define TS_SYSTEM    (1 << 2)
  119. #define TS_VOLID    (1 << 3)
  120. #define TS_SUBDIR    (1 << 4)
  121. #define TS_ARCH        (1 << 5)
  122.  
  123. #define TS_EJECT    (1 << 4)
  124. #define TS_QUEST    (1 << 5)
  125. #define TS_PROTECT    (1 << 6)
  126.  
  127. enum TSErrorCode {
  128.     ER_ABORT    = -0x2002,
  129.     ER_OBJX,
  130.     ER_NOTHEAD,
  131.     ER_NOTOBJECT,
  132.     ER_NOTLOAD,
  133.     ER_NOTPARA,
  134.     ER_FILENOTFND    = -0x1fe1,
  135.     ER_SERCHBREAK,
  136.     ER_SERCHONEDRV,
  137.     ER_DRVNOTREADY,
  138.     ER_RSCROUTEERR    = -0x1fdb
  139. };
  140.  
  141. struct Task {
  142.     char name[TS_NAMEMAX];
  143.     LASCII command;
  144.     short taskID;
  145.     short parentID;
  146.     short stMode;
  147.     long rscType;
  148.     short rscID;
  149.     short state;
  150.     void *programPtr;
  151.     Handle programHdl;
  152.     Handle dataHdl;
  153.     char *envPtr;
  154.     long regKeep[18];
  155.     short commSendID;
  156.     short commRecvID;
  157.     long tickCount;
  158.     Handle commonHdl;
  159.     long rsv1[3];
  160.     long refCon;
  161.     long rscChain;
  162.     short rsv2[16];
  163. };
  164.  
  165. struct Builtin {
  166.     short rscID;
  167.     char length;
  168.     char name[_VARLEN];        /* ここは可変長データの先頭    */
  169. };
  170.  
  171. struct Cell {
  172.     unsigned long kind;
  173.     long size;
  174.     unsigned char data[_VARLEN];    /* ここは可変長データの先頭    */
  175. };
  176.  
  177. struct Drag {
  178.     long size;
  179.     Handle cellList;
  180.     short taskID;
  181.     Point origen;
  182.     BitImg *image;
  183. };
  184.  
  185. struct Scrap {
  186.     long size;
  187.     Handle cellList;
  188. };
  189.  
  190. struct DrvInfo {
  191.     unsigned char mediaByte;
  192.     unsigned char unitno;
  193.     short driveno;
  194. };
  195.  
  196. struct OpenFile {
  197.     char name[TS_NAMEMAX];
  198.     short mode;
  199.     short ID;
  200. };
  201.  
  202. struct IcKind {
  203.     long type;
  204.     short ID;
  205.     short attrib;
  206.     short mLDown;
  207.     short menuID1;
  208.     short menuID2;
  209.     char nameLen;
  210.     char name[_VARLEN];        /* name[] は可変長データ    */
  211. /*    char execLen;
  212.     char exec[_VARLEN];           exec[] も可変長データ    */
  213. /*    unsigned char paramLen;
  214.     char param[_VARLEN];           param[] も可変長データ    */
  215. };
  216.  
  217. struct IcState {
  218.     Rect bounds;
  219.     char name[18 + 3];
  220.     unsigned char attrib;
  221.     long opt1;
  222.     long opt2;
  223.     unsigned char mediaByte;
  224.     unsigned char unitno;
  225.     short iconID;
  226.     char *path;
  227.     unsigned char flag;
  228.     unsigned char drawMode;
  229.     unsigned char rsv[4];
  230. };
  231.  
  232. #ifdef __PROTO_TYPE
  233.  
  234. Heap *TSInitTsk(void *, void *, const char *, int, int, int, Handle *);
  235. int TSInitCrtM(void);
  236. int TSTiniCrtM(int);
  237. int TSFock(int, int, char *, const char *, const char *, long, int);
  238. int TSFockB(int, BOOLEAN, const char *, const char *, const char *, char *);
  239. int TSFockSItem(Handle);
  240. int TSFockIcon(IcState *, int, BOOLEAN, char *, char *);
  241. int TSEventAvail(int, TsEvent *);
  242. int TSGetEvent(int, TsEvent *);
  243. int TSPostEventTsk(long, long, int, BOOLEAN, BOOLEAN);
  244. int TSGetTdb(Task *, int);
  245. int TSSetTdb(Task *, int);
  246. LPoint TSGetWindowPos(void);
  247. int TSCommunicate(int, TsEvent *, int);
  248. int TSGetID(void);
  249. int TSMakeEvent(long, long, int, BOOLEAN, BOOLEAN, TsEvent *);
  250. BOOLEAN TSGetStartMode(void);
  251. void TSSetStartMode(int);
  252. int TSOpen(const char *, int);
  253. int TSClose(int);
  254. int TSRmDirH(char **);
  255. int TSCopyH(char **, char **);
  256. int TSMkDirH(char **);
  257. int TSMoveH(char **, char **);
  258. int TSCreate(const char *, int);
  259. int TSDeleteH(char **);
  260. int TSTrash(char **, char **);
  261. int TSFiles(void *, const char *, int);
  262. int TSNFiles(void *, const char *, int);
  263. int TSCopyP(const char *, const char *);
  264. int TSDeleteP(const char *);
  265. int TSRmDirP(const char *);
  266. int TSMkDirP(const char *);
  267. int TSMoveP(const char *, const char *);
  268. int TSChMod(const char *, int);
  269. long TSWhatFile(TsEvent *, const char *);
  270. int TSDeleteVoname(const char *);
  271. int TSCreateVoname(const char *);
  272. long TSSearchFileND(const char *, char *, const char *);
  273. int TSGetOpen(OpenFile ***);
  274. int TSZeroDrag(void);
  275. int TSPutDrag(long, Handle);
  276. int TSGetDrag(Drag **);
  277. int TSBeginDrag(LPoint);
  278. int TSEndDrag(int);
  279. int TSHideDrag(void);
  280. int TSShowDrag(void);
  281. int TSZeroScrap(void);
  282. int TSPutScrap(long, Handle);
  283. long TSGetScrap(Scrap **);
  284. int TSSearchTrashpath(char **);
  285. int TSSearchTrashfile(char **);
  286. int TSEmptyTrash(void);
  287. int TSSearchdpb(int, int);
  288. int TSDrvctrl(int, int);
  289. int TSDrvctrl2(int, int);
  290. int SXCallWindM(Window *, TsEvent *);
  291. int SXCallCtrlM(Window *, TsEvent *, Control **, Control **, Rect *, Control ***);
  292. int SXInvalScBar(Window *);
  293. int SXValidScBar(Window *);
  294. int TSISRecToStr(IcState *, char *);
  295. int TSCreateISFile(char **, IcState *);
  296. BOOLEAN SXFileConnPath(const char *, const char *);
  297. int SXFileInPath(const char *, const char *);
  298. int SXFnamecmp(const char *, int, const char *, int);
  299. long SXSearchFname(const char *, char **);
  300. int SXVer(void);
  301. int TSTakeParam(const _LASCII, Rect *, char *, int, char **, char **);
  302. long TSFindTskn(const char *, int);
  303. int TSDriveCheckAll(BOOLEAN);
  304. int TSDriveCheck(int);
  305. int TSISRecToExec(IcState *, char *, _LASCII);
  306. BOOLEAN TSGetDtopMode(void);
  307. void TSSetDtopMode(BOOLEAN);
  308. int TSSearchOpen(char **, int, int, OpenFile **);
  309. long TSFindOwn(void);
  310. int TSCommunicateS(int, TsEvent *, int);
  311. long TSSearchFile2(int, int, void *, const char *, char *, const char *);
  312. long TSSearchFile(const char *, char *, const char *);
  313. int SXStrCmp(const char *, const char *, int);
  314. int TSCreateISBadge(IcState *, int, int);
  315. int TSGetCMDS(int, char *);
  316. int TSFockCM(int, BOOLEAN, int, const char *, const char *, char *);
  317. int TSTiniTsk(void);
  318. int TSPostEventTsk2(long, long, int, BOOLEAN, BOOLEAN, int);
  319. int TSAnswer(TsEvent *);
  320. int TSSendMes(int, TsEvent *);
  321. BOOLEAN TSGetMes(TsEvent *, BOOLEAN);
  322. Heap *TSInitTsk2(void *, void *, const char *, int, BOOLEAN, int, char *, Handle *);
  323. int SXCallWindM2(Window *, TsEvent *, Rect *);
  324. int TSBeginDrag2(LPoint, void *, long);
  325. void *SXGetVector(int);
  326. void *SXSetVector(int, void *);
  327. long TSCellToStr(Handle, char *, long, char ***);
  328. void SXLockFSX(void);
  329. void SXUnlockFSX(void);
  330. int TSFockMode(const char *, char *, long *);
  331. int TSSetGraphMode(BOOLEAN, int);
  332. long TSGetGraphMode(long *);
  333. int SXGetDispRect(Rect *);
  334. int SXSRAMVer(void);
  335. void SXSRAMReset(void);
  336. int SXSRAMCheck(void);
  337. void TSAdjustRect(Rect *, Rect *, int);
  338. int TSPostEventTsk3(long, long, int, int, int, int, long, long);
  339. int TSAnswer2(long, long, int, int, int, int, long, long);
  340. int TSErrDialogN(int, const char *);
  341. long TSSearchFile3(int, int, const char *, char *, const char *, int (*)(const char *, long));
  342. Handle TSResNew(void);
  343. Handle TSResOpen(const char *);
  344. int TSResClose(const char *);
  345. int TSResSave(const char *);
  346. int TSResRemove(void);
  347. int TSResLoad(void);
  348. int TSResDispose(void);
  349. Handle TSCurResGet(void);
  350. Handle TSLastResGet(void);
  351. Handle TSCurResSet(Handle);
  352. _Handle TSRscAdd(long, int, _Handle, long);
  353. _Handle TSRscGet(long, int);
  354. int TSRscRemove(long, int);
  355. int TSTypeRemove(long);
  356. int TSRscRelease(_Handle);
  357. int TSRscDetach(_Handle);
  358. int TSMaxIDGet(long);
  359. Handle TSHdlToRsc(_Handle);
  360. Handle TSResLinkGet(Handle);
  361. long TSResRouteLink(int, long);
  362. long TSResRouteGet(int);
  363. _Handle TSRscGet2(long, int, long);
  364. _Handle TSRscGet3(long, int);
  365. int TSResRouteUnLink(void);
  366. int TSMaxIDGet2(long, long);
  367. Handle TSFind(_Handle, long *, long *);
  368. Handle TSCurResGet2(long);
  369. int TSMaxIDGet3(long);
  370. int TSResFileGet(Handle, char *);
  371. long TSResRouteFind(const char *, int, long);
  372. int TSResTypeList(int *, long ***, Handle);
  373. int TSResIDList(int *, short ***, Handle, long);
  374. void (*TSSetAbort(void (*)(), long))();
  375. Window *TSReferWM(int, Window *, Window *);
  376. Control **TSReferCM(int, Window *);
  377. Menu **TSReferMN(int);
  378. Dialog *TSReferDM(int, Dialog *, Window *);
  379.  
  380. #undef __PROTO_TYPE
  381. #else
  382.  
  383. Heap *TSInitTsk();
  384. int TSInitCrtM();
  385. int TSTiniCrtM();
  386. int TSFock();
  387. int TSFockB();
  388. int TSFockSItem();
  389. int TSFockIcon();
  390. int TSEventAvail();
  391. int TSGetEvent();
  392. int TSPostEventTsk();
  393. int TSGetTdb();
  394. int TSSetTdb();
  395. LPoint TSGetWindowPos();
  396. int TSCommunicate();
  397. int TSGetID();
  398. int TSMakeEvent();
  399. BOOLEAN TSGetStartMode();
  400. void TSSetStartMode();
  401. int TSOpen();
  402. int TSClose();
  403. int TSRmDirH();
  404. int TSCopyH();
  405. int TSMkDirH();
  406. int TSMoveH();
  407. int TSCreate();
  408. int TSDeleteH();
  409. int TSTrash();
  410. int TSFiles();
  411. int TSNFiles();
  412. int TSCopyP());
  413. int TSDeleteP());
  414. int TSRmDirP();
  415. int TSMkDirP();
  416. int TSMoveP();
  417. int TSChMod();
  418. long TSWhatFile();
  419. int TSDeleteVoname();
  420. int TSCreateVoname();
  421. long TSSearchFileND();
  422. int TSGetOpen();
  423. int TSZeroDrag();
  424. int TSPutDrag();
  425. int TSGetDrag());
  426. int TSBeginDrag();
  427. int TSEndDrag();
  428. int TSHideDrag();
  429. int TSShowDrag();
  430. int TSZeroScrap();
  431. int TSPutScrap();
  432. long TSGetScrap();
  433. int TSSearchTrashpath();
  434. int TSSearchTrashfile();
  435. int TSEmptyTrash();
  436. int TSSearchdpb();
  437. int TSDrvctrl();
  438. int TSDrvctrl2();
  439. int SXCallWindM();
  440. int SXCallCtrlM();
  441. int SXInvalScBar();
  442. int SXValidScBar();
  443. int TSISRecToStr();
  444. int TSCreateISFile();
  445. BOOLEAN SXFileConnPath();
  446. int SXFileInPath();
  447. int SXFnamecmp();
  448. long SXSearchFname());
  449. int SXVer();
  450. int TSTakeParam();
  451. long TSFindTskn();
  452. int TSDriveCheckAll();
  453. int TSDriveCheck();
  454. int TSISRecToExec();
  455. BOOLEAN TSGetDtopMode();
  456. void TSSetDtopMode();
  457. int TSSearchOpen();
  458. long TSFindOwn();
  459. int TSCommunicateS();
  460. long TSSearchFile2();
  461. long TSSearchFile();
  462. int SXStrCmp();
  463. int TSCreateISBadge();
  464. int TSGetCMDS();
  465. int TSFockCM();
  466. int TSTiniTsk();
  467. int TSPostEventTsk2();
  468. int TSAnswer();
  469. int TSSendMes();
  470. BOOLEAN TSGetMes();
  471. Heap *TSInitTsk2();
  472. int SXCallWindM2();
  473. int TSBeginDrag2();
  474. void *SXGetVector();
  475. void *SXSetVector();
  476. long TSCellToStr();
  477. void SXLockFSX();
  478. void SXUnlockFSX();
  479. int TSFockMode();
  480. int TSSetGraphMode();
  481. long TSGetGraphMode();
  482. int SXGetDispRect();
  483. int SXSRAMVer();
  484. void SXSRAMReset();
  485. int SXSRAMCheck();
  486. void TSAdjustRect();
  487. int TSPostEventTsk3();
  488. int TSAnswer2();
  489. int TSErrDialogN();
  490. long TSSearchFile3();
  491. Handle TSResNew();
  492. Handle TSResOpen();
  493. int TSResClose();
  494. int TSResSave();
  495. int TSResRemove();
  496. int TSResLoad();
  497. int TSResDispose();
  498. Handle TSCurResGet();
  499. Handle TSLastResGet();
  500. Handle TSCurResSet();
  501. _Handle TSRscAdd();
  502. _Handle TSRscGet();
  503. int TSRscRemove();
  504. int TSTypeRemove();
  505. int TSRscRelease();
  506. int TSRscDetach();
  507. int TSMaxIDGet();
  508. Handle TSHdlToRsc();
  509. Handle TSResLinkGet();
  510. long TSResRouteLink();
  511. long TSResRouteGet();
  512. _Handle TSRscGet2());
  513. _Handle TSRscGet3();
  514. int TSResRouteUnLink();
  515. int TSMaxIDGet2();
  516. Handle TSFind();
  517. Handle TSCurResGet2();
  518. int TSMaxIDGet3();
  519. int TSResFileGet();
  520. long TSResRouteFind();
  521. int TSResTypeList();
  522. int TSResIDList();
  523. void (*TSSetAbort())();
  524. Window *TSReferWM();
  525. Control **TSReferCM();
  526. Menu **TSReferMN();
  527. Dialog *TSReferDM();
  528.  
  529. #endif __PROTO_TYPE
  530.  
  531. #endif __TASK_H
  532.